﻿#region using
using System;
using System.ComponentModel;
using System.Runtime.Serialization;

#endregion

namespace Linq2Crm.ObjectModel.DomainObject.Iternal
{
   /// <summary>
   /// For internal use only. It won't make much sense if you're be using it.
   /// </summary>
   [DataContract(Name = "DefaultGridView", Namespace = "")]
   [EditorBrowsable(EditorBrowsableState.Never)]
   public class DefaultGridView
   {
      [DataMember(IsRequired = true, EmitDefaultValue = false)]
      public int EntityTypeCode { get; set; }

      [DataMember(IsRequired = false, EmitDefaultValue = false)]
      public string ChildEntityName { get; set; }

      [DataMember(IsRequired = false, EmitDefaultValue = false)]
      public string QueueId { get; set; }

      [DataMember(IsRequired = false, EmitDefaultValue = false)]
      public string ViewId { get; set; }

      [DataMember(IsRequired = false, EmitDefaultValue = false)]
      public int ViewType { get; set; }

      public Guid ViewGuid
      {
         get
         {
            return String.IsNullOrEmpty(ViewId)
                      ? Guid.Empty
                      : Guid.Parse(ViewId);
         }
      }
   }
}